using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter09
{
	/// <summary>
	/// Example01: The Archer
	/// Let us consider the situation proposed at the beginning 
	/// of this section. A 60 kg archer stands at rest on 
	/// frictionless ice and fires a 0.50 kg arrow horizontally 
	/// at 50 m/s (Fig.9.2). With what velocity does the archer 
	/// move across the ice after firing the arrow?
	/// v_{1f} = -0.42 m/s
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Mass m1 = new L.Mass();
			m1.kg = 60.0;
			L.Mass m2 = new L.Mass();
			m2.kg = 0.5;
			L.Velocity v1 = new L.Velocity();
			L.Velocity v2 = new L.Velocity();
			v2.X = 50.0;
			L.Momentum[] pi = new L.Momentum[2];
			pi[0] = new L.Momentum();
			pi[1] = new L.Momentum();
			L.Momentum[] pf = new L.Momentum[2];
            pf[0] = new L.Momentum(m1,v1);
			pf[1] = new L.Momentum(m2,v2);
			pf[0].XVariableQ = true;
			L.FundamentalLaw.MomentumConservation(pi,pf);
            result+=Convert.ToString(pf[0].X/m1.kg)+"\r\n";
		}
	}
}
